       
 import news from '../components/news.js'
        
var app= new Vue({
    el: "#app",
    data: {
        newsList: [],
        style: {
            width: "400px",
            margin: "0 auto"
        }
     },
     components: {
        'news-list':news  
    },
    created() {
        let xhr = new XMLHttpRequest();
        let url = "http://api.tianapi.com/esports/index?key=e5df028fd20892f8103f9724e6dd85cf&num=10";
        xhr.open("GET", url);
        xhr.send();
        xhr.onload = function () {
            app.newsList = JSON.parse(xhr.response).newslist;

        };
        console.log(this.newsList);
    }
})
